package com.zjitc.config;

import com.zjitc.obj.Home;
import com.zjitc.obj.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Scope;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/6 15:47
 * @description:
 */
@Configuration
public class JavaConfigDome1 {
  //@Bean(value = "u2")
  //public Home home()
  //{
  //  return new Home("long");
  //}
  @Bean(value = "u1")
  @Scope(value = "prototype")//默认是单例
  public User user()
  {
    Home home=new Home();
    home.setAddr("long");
     return new User("guoxu",20,home);
  }

}
